/*
 * 保存入库订单请求DTO
 */
using System;
using System.Collections.Generic;

namespace VOL.Entity.DomainModels
{
    /// <summary>
    /// 保存入库订单请求
    /// </summary>
    public class SaveStockInOrderRequest
    {
        /// <summary>
        /// 入库单主表信息
        /// </summary>
        public StockInOrderDto StockInOrder { get; set; }

        /// <summary>
        /// 入库单明细列表
        /// </summary>
        public List<StockInOrderItemDto> OrderItems { get; set; }
    }

    /// <summary>
    /// 入库单DTO
    /// </summary>
    public class StockInOrderDto
    {
        public string stockInCode { get; set; }
        public long? warehouseId { get; set; }
        public DateTime? stockInDate { get; set; }
        public string relatedOrderCode { get; set; }
        public long? supplierId { get; set; }
        public string contactPerson { get; set; }
        public string contactPhone { get; set; }
        public int? userId { get; set; }
        public string remark { get; set; }
        public int? status { get; set; }
        public long? inOutTypeId { get; set; }  // 类型（1:进货入库, 2:销售退货）
    }

    /// <summary>
    /// 入库单明细DTO
    /// </summary>
    public class StockInOrderItemDto
    {
        public long GoodsId { get; set; }
        public long? UnitId { get; set; }
        public int? thisTimeQuantity { get; set; }  // 本次入库数量（支持分批入库）
        public long? stockPosition { get; set; }
        public string upprice { get; set; }  // 本次入库金额（varchar类型）
        public string batchNo { get; set; }
        public DateTime? productionDate { get; set; }
        public DateTime? expireDate { get; set; }
        public string ItemRemark { get; set; }
    }

    /// <summary>
    /// 查询进货单货品DTO
    /// </summary>
    public class PurchaseOrderGoodsDto
    {
        public long Id { get; set; }
        public string OrderCode { get; set; }
        public DateTime? OrderDate { get; set; }
        public long SupplierId { get; set; }
        public string SupplierName { get; set; }
        public decimal? TotalAmount { get; set; }
        public int? TotalQuantity { get; set; }
        public List<PurchaseOrderGoodsItemDto> Items { get; set; }
    }

    /// <summary>
    /// 进货单货品明细DTO
    /// </summary>
    public class PurchaseOrderGoodsItemDto
    {
        public long GoodsId { get; set; }
        public string GoodsCode { get; set; }
        public string GoodsName { get; set; }
        public string SpecModel { get; set; }
        public long? UnitId { get; set; }
        public string UnitName { get; set; }
        public int? CurrentInventory { get; set; }  // 当前库存
        public decimal? PurchasePrice { get; set; }
        public int? PurchaseQuantity { get; set; }
        public int? InStockedQuantity { get; set; }
        public int? UnStockedQuantity { get; set; }
        public decimal? Amount { get; set; }
    }
}


